import React, { Component } from 'react';
import '../../../../assets/styles/shouye.css';
import req from '../../../../http/req'
import url from '../../../../config/url'
import { message } from 'antd';

class Dele extends Component {
    render() {
        return (
            <div>
                <button onClick={this.delehander} className='dele'>删除</button>
            </div>
        );
    }
    delehander=()=>{
    //    console.log(this.props.record.id)
       const id=this.props.record.id
        req.delete(url.GetUsersData+id).then((res)=>{
            // console.log(res)
            if(res.data.errNo===0){
                message.success('删除成功');
            }else{
                message.warning('删除失败');
            }
        })
    }
}

export default Dele;
